%%%新生成z_max=360的矩阵和原z_max=256矩阵的比较
clc;
clear all;
close all;
%% z_max=360
snr_45 = [0,0.2,0.4,0.6,0.8,1.0,1.2,1.4,1.6,1.8,2.0,2.2];
ber_45 = [0.13122222,0.12888889,0.10408654,0.08081450,0.05952093,0.04339506,0.01446047,0.00573174,0.00086277,0.00015847,0.00001941,0.00000384];
snr_90 = [0,0.2,0.4,0.6,0.8,1.0,1.2,1.4,1.6,1.8];
ber_90 = [0.13152778,0.11934722,0.11123611,0.09491186,0.05661765,0.02150901,0.00447154,0.00064888,0.00003816,0.00000089];
snr_180 = [0,0.2,0.4,0.6,0.8,1.0,1.2,1.4,1.6];
ber_180 = [0.13043056,0.12087500,0.10868750,0.08885485,0.05728009,0.01110114,0.00090191,0.00001630,0.00000029];
snr_360 = [0,0.2,0.4,0.6,0.8,1.0,1.2,1.4];
ber_360 = [0.13374306,0.11922569,0.10986458,0.08845139,0.04972756,0.00495124,0.00005817,0.00000010];

figure;
semilogy(snr_45,ber_45,'b-p');
hold on;
semilogy(snr_90,ber_90,'r-o');
hold on;
semilogy(snr_180,ber_180,'m-s');
hold on;
semilogy(snr_360,ber_360,'k-d');
hold on;
xlabel('snr');
ylabel('ber');
legend('1440码长','2880码长','5760码长','11520码长');
grid on;
title('zmax=360误码率性能曲线'); 

%%z_max=256
snr_45 = [0,0.2,0.4,0.6,0.8,1.0,1.2,1.4,1.6,1.8,2.0,2.2];
ber_45 = [0.13202778,0.12102778,0.10969551,0.08534226,0.05377252,0.02621136,0.01373916,0.00460771,0.00077218,0.00016660,0.00001240,0.00000336];
snr_90 = [0,0.2,0.4,0.6,0.8,1.0,1.2,1.4,1.6,1.8];
ber_90 = [0.13030556,0.11590278,0.10725763,0.08094697,0.05692460,0.01895576,0.00584596,0.00087546,0.00003754,0.00000071];
snr_180 = [0,0.2,0.4,0.6,0.8,1.0,1.2,1.4,1.6];
ber_180 = [0.12961111,0.12290278,0.10910417,0.09567361,0.04517173,0.01123888,0.00119500,0.00001535,0.00000011];
snr_360 = [0,0.2,0.4,0.6,0.8,1.0,1.2,1.4];
ber_360 = [0.13194792,0.11974653,0.10953125,0.08815700,0.04926487,0.00499916,0.00006095,0.00000020];

figure;
semilogy(snr_45,ber_45,'b-.p');
hold on;
semilogy(snr_90,ber_90,'r-.o');
hold on;
semilogy(snr_180,ber_180,'m-.s');
hold on;
semilogy(snr_360,ber_360,'k-.d');
xlabel('snr');
ylabel('ber');
legend('1440码长','2880码长','5760码长','11520码长');
grid on;
title('zmax=256误码率性能曲线'); 


